﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MachiningHelper.ToolFile
{
    #region 刀具文件 水平孔表模型
    public class HdrillSeq
    {
        public string CurrentFace { get; set; }
        public string PreviousFace { get; set; }
        public string HDrillX { get; set; }
        public string HDrillY { get; set; }
        public string HDrillZ { get; set; }
        public string HDrillDiameter { get; set; }
        public string HDrillToolName { get; set; }
        public string HDrillFeedSpeed { get; set; }
        public string HDrillEntrySpeed { get; set; }
        public string HDrillBitType { get; set; }
        public string HDrillFirstDrillDone { get; set; }
        public string HDrillPreviousToolName { get; set; }
        public string HDrillNextToolName { get; set; }
        public string HDrillCounter { get; set; }
        public static HdrillSeq LoadSeq(string line)
        {
            HdrillSeq hds = new HdrillSeq();
            var pars = line.Split(',');

            int count = pars.Count();

            hds.CurrentFace = pars[1];
            hds.PreviousFace = pars[2];
            hds.HDrillX = pars[3];
            hds.HDrillY = pars[4];
            hds.HDrillZ = pars[5];
            hds.HDrillDiameter = pars[6];
            hds.HDrillToolName = pars[7];
            hds.HDrillFeedSpeed = pars[8];
            hds.HDrillEntrySpeed = pars[9];
            hds.HDrillBitType = pars[10];
            hds.HDrillFirstDrillDone = pars[11];
            hds.HDrillPreviousToolName = pars[12];
            hds.HDrillNextToolName = pars[13];
            hds.HDrillCounter = count <= 14 ? string.Empty : pars[14];
            return hds;
        }

    }
    #endregion
}
